/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package us.icitap.cm.business.entities.regmin;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author klau
 */
@Embeddable
public class CitiesPK implements Serializable {
    @Column(name = "CODE_STATE", nullable = false)
    private String codeState;
    @Column(name = "CODE_CITY", nullable = false)
    private String codeCity;

    public CitiesPK() {
    }

    public CitiesPK(String codeState, String codeCity) {
        this.codeState = codeState;
        this.codeCity = codeCity;
    }

    public String getCodeState() {
        return codeState;
    }

    public void setCodeState(String codeState) {
        this.codeState = codeState;
    }

    public String getCodeCity() {
        return codeCity;
    }

    public void setCodeCity(String codeCity) {
        this.codeCity = codeCity;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codeState != null ? codeState.hashCode() : 0);
        hash += (codeCity != null ? codeCity.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CitiesPK)) {
            return false;
        }
        CitiesPK other = (CitiesPK) object;
        if ((this.codeState == null && other.codeState != null) || (this.codeState != null && !this.codeState.equals(other.codeState))) {
            return false;
        }
        if ((this.codeCity == null && other.codeCity != null) || (this.codeCity != null && !this.codeCity.equals(other.codeCity))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.CitiesPK[codeState=" + codeState + ", codeCity=" + codeCity + "]";
    }

}
